﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using MasterDetailTemplate.Services;
using MasterDetailTemplate.Services.impl;
using Moq;

namespace MasterDetailTemplateTest.Helper
{
    public static class FavoriteStorageServiceHelper
    {
        public static async Task<IFavoriteStorageService> getFavoriteStorage()
        {
            var preferenceMock = new Mock<IPreferenceStorage>();
            IFavoriteStorageService favoritrStorage =
                new FavoriteStorageService(preferenceMock.Object);
            await favoritrStorage.InitializeAsync();
            return favoritrStorage;
        }

        public static void removeDatabase()
        {
            File.Delete(FavoriteStorageService.DBPath);
        }
    }
}
